import request from '@/router/axios';
import qs from 'qs';

// 查询借出申请列表
export const getListOfSearch = (data) => request({
    url: '/borrowingAppointment/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})

// 查询仓库列表
export const getListLab = (data) => request({
    url: '/warehouse/v1/findAll',
    method: 'post',
    data: qs.stringify(data),
})

// 查询设备类型 tree
export const getDevTypeList = (data) => request({
    url: '/equipmentType/v1/findAllType',
    method: 'post',
    data: qs.stringify(data),
})

// 条件查询 设备列表
export const pageQueryDevList = (data) => request({
    url: '/equipment/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})

// 新增借出 批量
export const addAppointment = (data) => request({
    url: '/borrowingAppointment/v1/insertBatch',
    method: 'post',
    data: data,
})

// 审批流程
export const approvalProcess = (data) => request({
    url: '/borrowingAppointment/v1/approvalProcess',
    method: 'post',
    data: qs.stringify(data),
})

// 查询借出单详情
export const findById = (data) => request({
    url: '/borrowingAppointment/v1/findByPrimaryKey',
    method: 'post',
    data: qs.stringify(data),
})

// 审核 通过/不通过
export const approvalNumberVerify = (data) => request({
    url: '/borrowingAppointment/v1/approvalNumberVerify',
    method: 'post',
    data: qs.stringify(data),
})

// 修改借出单
export const updateReservation = (data) => request({
    url: '/borrowingAppointment/v1/update',
    method: 'post',
    data: qs.stringify(data),
})

// 删除借出单
export const delReservation = (data) => request({
    url: '/borrowingAppointment/v1/getById',
    method: 'post',
    data: qs.stringify(data),
})

